﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/CompanyCenter.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:SiteResource.Title() %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="/Scripts/library.js" charset="GB2312"></script>
    <script type="text/javascript" src="/Scripts/plug.js" charset="GB2312"></script>
    <script type="text/javascript">
        function DeleteDeposit(sender, id) {
            if (confirm('您确定要删除该代理企业信息？')) {
                $.ajax({
                    url: '/CompanyCenter/DeleteDepositCompany',
                    data: { id: id },
                    type: 'get',
                    success: function (result) {
                        if (result == '1') {
                            $(sender).parent().parent().parent().remove();
                        }
                    }
                });
            }
        }
        function OpenFrame(id) {
            $('#waitlayer').show();
            $('#datalayer').hide();
            var pluglib = new plug.PopFrame();
            pluglib.OpenFrame('laydepcop', 'btnclose', function () {
                $.ajax({
                    url: '/CompanyCenter/GetDeposiCompany',
                    data: { id: id },
                    dataType: 'json',
                    success: function (result) {
                        $('#waitlayer').hide();
                        $('#txtcopName').text(result.CompanyName);
                        $('#txtbiz').text(result.CompanyBusiness);
                        $('#txttype').text(result.CompanyType);
                        $('#txtdim').text(result.CompanyDimensions);
                        $('#txtdesc').html(result.CompanyDetail);
                        $('#datalayer').show();
                    }
                });
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <div id="laydepcop" style="display:none;width:350px;height:280px;">
        <div><a href="javascript:;" id="btnclose">关闭</a></div>
        <div id="waitlayer">数据加载中，请稍后</div>
        <div id="datalayer">
        <div>
        <label>企业名称：</label><label id="txtcopName"></label>
        </div>
        <div>
        <label>行业：</label><label id="txtbiz"></label>
        </div>
        <div>
        <label>企业类型：</label><label id="txttype"></label>
        </div>
        <div>
        <label>人员规模：</label><label id="txtdim"></label>
        </div>
        <div>
        <label>企业简介：</label>
        <div id="txtdesc">
            
        </div>
        </div>
        </div>
    </div>
    <div class="usercenter-main">
        <div class="usercenter-main-topbg">
        </div>
        <div class="usercenter-main-content">
            <div class="usercenter-main-content-title">
                <div class="usercenter-main-content-title-left">
                    代理企业管理</div>
            </div>
            <div class="usercenter-notes">
                在这里，你可以维护你的代理企业信息，代理企业由兼职发布时自动保存，用户可在此对代理企业进行维护以便再次使用！</div>
            <div class="listbox2">
                <%var list = ViewData["Data"] as ItemListBox<DepositCompanyModel>;
                  if (list != null && list.Data.Any())
                  {
                      foreach (var item in list.Data)
                      { %>
                <div class="listbox-item">
                    <div class="listbox-item-title">
                        <div class="left">
                            <a href="javascript:;" onclick="OpenFrame(<%:item.Id %>)"><%:item.CompanyName%></a></div>
                        <div class="right">
                            <a href="javascript:;" onclick="DeleteDeposit(this,'<%:item.Id %>')">删除</a></div>
                    </div>
                    <div class="listbox-item-bottomline">
                    </div>
                </div>
                <%}
                }
                else
                {%>
                <div class="listbox-item">
                    你没有添加过代理企业信息。在您<a target="_blank" href="/CompanyCenter/Recruiting">发布兼职</a>的时候，您可以选择'保存企业'以便在下次能够快速创建
                    <div style="width:690px;height:120px; border:1px solid #900808;">
                        <img style="width:685px;height:118px;" src="/content/images/example.png" alt="example" />
                    </div>
                    <div class="listbox-item-bottomline"></div>
                </div>
                <%} %>
                <div class="listbox-bottom">
                    <div class="listbox-bottom-item">
                        <!--下一页-->
                        <%if (list.NextPage <= 0 || list.NextPage >= list.TotlePage-1)
                          { %>
                        <a class="next1" href="javascript:;"></a>
                        <%}
                          else
                          { %>
                        <a class="next" href="?page=<%:list.NextPage %>"></a>
                        <%} %>
                    </div>
                    <div class="listbox-bottom-item">
                        <!--上一页-->
                        <%if (list.CurrentPage != 1 && list.PrePage <= 0)
                          { %>
                        <a class="prev1" href="javascript:;"></a>
                        <%}
                          else
                          { %>
                        <a class="prev" href="?page=<%:list.PrePage %>"></a>
                        <%} %>
                    </div>
                    <div class="listbox-bottom-item">
                        <%:list.CurrentPage + 1%>/<%:list.TotlePage%>&nbsp;&nbsp;&nbsp;
                    </div>
                </div>
            </div>
        </div>
        <div class="usercenter-main-bottombg">
        </div>
    </div>
</asp:Content>
